package com.systop.dxjj.modules.findteacher.mapper;

import com.systop.dxjj.common.pojo.Findteacher;
import com.systop.dxjj.common.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @author 吴健伟
 */
@Mapper
public interface FindteacherMapper {
    @Select("select * from findteacher")
    List<Findteacher> selectAllTeacherInfo();

    /**
     *插入
     */
    @Insert("insert into findteacher(realname,phone,sex,identity,try_Teachtime,try_Price,try_Rule,teachtype,adeptclass,teachexperience)" +
            " values (#{realname},#{phone},#{sex},#{identity},#{tryTeachtime}," +
            "#{tryPrice},#{tryRule},#{teachtype},#{adeptclass},#{teachexperience})")
    int insertFindteacher(Findteacher findteacher);

    /**
     *更新
     */
    @Update("update findteacher set realname=#{realname},phone=#{phone}," +
            "sex=#{sex},identity=#{identity},try_Teachtime=#{tryTeachtime},try_Price=#{tryPrice}," +
            "try_Rule=#{tryRule},teachtype=#{teachtype},adeptclass=#{adeptclass}," +
            "teachexperience=#{teachexperience} where teachid=#{teachid}")
    int updateFindteacher(Findteacher findteacher);

    /**
     *删除
     */
    @Delete("delete from findteacher where teachid=#{teachid}")
    int deleteFindteacher(Integer id);


    @Select("select * from findteacher where realname like \"%\"#{realname}\"%\"")
    List<Findteacher> selectTeacherInfoByName(String name);

    @Select("select * from findteacher limit #{pageNum},#{pageSize}")
    List<Findteacher>findByPage(@Param("pageNum")Integer pageNum,@Param("pageSize")Integer pageSize);
}
